//
//  UIView+viewController.m
//  项目一TimeMovie
//
//  Created by apple on 16/4/9.
//  Copyright © 2016年 huangmingyu. All rights reserved.
//

#import "UIView+viewController.h"

// 你到底想干嘛
@implementation UIView (viewController)

- (UIViewController *)viewController {
    
    UIResponder *next = self.nextResponder;
    
    while (1) {
        
        if ([next isKindOfClass:[UIViewController class]]) {
            
            break;
        } else {
            next = next.nextResponder;
        }
    }
    return (UIViewController *)next;
}

@end
